<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>键盘事件处理</title>
</head>
<body>
<div id="app">
    <input type="text" v-on:keyup.enter="onKey" id="wd">
    <br>
    <input type="text" v-on:keyup="onTest" v-model="content">
</div>
<script type="module">
    import {createApp, ref} from "../../../../js/vue.esm-browser.js";

    const app = createApp({
        setup() {
            let content = ref(null)

            function onKey() {
                // console.log("abcd");
                let element = document.getElementById("wd")
                console.log(element.value);

            }

            function onTest() {

                console.log(content);
            }

            return {
                content,
                onKey,
                onTest,
            }
        }
    })

    app.mount("#app")
</script>
</body>
</html>